<template>
  <div class="login" v-if="loginStore.openLogin">
    <a-modal v-model:open="loginStore.openLogin" title="" :footer=null width="380px">
      <div class="login_content">
        <div class="loading" v-if="!loginStore.qrUrl">
          <loading>
            <template>正在获取二维码...</template>
          </loading>
        </div>
        <template v-else>
          <div class="qr">
            <h3>请使用微信App扫描</h3>
            <a-space direction="vertical" align="center">
              <a-qrcode :value="loginStore.qrUrl" />
            </a-space>
          </div>
          <div class="check" v-if="userStore.loginState == 2">
            <!-- <img src="../../assets/img/login/readylogin.png"> -->
            <h3>扫码成功</h3>
            <h4>请授权进行登录</h4>
          </div>
        </template>
      </div>
    </a-modal>
  </div>
</template>

<script setup lang="ts">
import { useLoginStore } from '@/stores/module/login';
import { useUserStore } from '@/stores/module/user';
import { onMounted } from 'vue';
import loading from '../loading/loading.vue';
const loginStore = useLoginStore()
const userStore = useUserStore()

onMounted(() => {

  // wsLoginConnect()
})

</script>

<style lang="less" scoped>
.login_content {
  margin: 0 auto;
  width: 220px;
  height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  h3 {
    margin-bottom: 18px;
    font-size: large;
    font-weight: 600;
  }

    .check{
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      img{
        width: 100px;
        height: 100px;
      }


  }
}
</style>
